<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>电子签章接口记录</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
    <script type="text/javascript">
        var grid = null;
        var callback = function () {
            grid.reload();
        };
        $(function () {
            $("#searchBar").ligerForm();
                     
            $("#ligergrid1").ligerGrid({
                url: '<%=path%>/esign/signExtIfL/initList.do',
                method : 'get',
                columns: [
                    { display: '接口名', name: 'txCode', minWidth: 80, align: 'center', enabledSort:true,
                    	render: function (rowdata, rowindex, value){
    	                    if('05001' == value){
    	                    	return '四要素验证';
    	                    }else if('3001'== value){
    	                    	return '注册';
    	                    }else if('06004' == value){
    	                        return "三要素验证";
                            }
    	                }		
                    },
                    { display: '结果', name: 'recCode', minWidth: 50, align: 'center', enabledSort:true,
                    	render: function (rowdata, rowindex, value){
    	                    if('0' == value){
    	                    	return '失败';
    	                    }else if('1'== value){
    	                    	return '成功';
    	                    }else if ('2' == value){
    	                        return '异常';
                            }
    	                }	
                    },
                    { display: '创建时间', name: 'crtTm', minWidth: 100, align: 'center', render:renderDate},
                    { display: '返回结果', name: 'recResult', minWidth: 200, align: 'center', enabledSort:true,
                    	render: function (rowdata, rowindex, value){
                    		var h='<a href="javascript:showDetail('+rowindex+')"><span class="gridTip" title='+"'"+ value +"'"+'>'+ value +'</span></a>';
    	                    if(value == null){
    	                    	return "";
    	                    }else{
    	                    	return h;
    	                    }
    	                }	
                    },
                    { display: '接口内容', name: 'content', minWidth: 450, align: 'center', enabledSort:true,
                    	render: function (rowdata, rowindex, value){
    	                    var h='<a href="javascript:showDetailC('+rowindex+')"><span class="gridTip" title='+"'"+ value +"'"+'>'+ value +'</span></a>';
    	                    if(value == null){
    	                    	return "";
    	                    }else{
    	                    	return h;
    	                    }
    	                }		
                    }
                   
                    
                ],
                pageSize:10,
                root:'rows',
                record:'total',
                hideLoadButton : true,
                width: '100%',
                height:'100%',
                heightDiff:-2,
                //checkbox:true,
                rownumbers:true
            });
            grid = liger.get("ligergrid1");

            $("#searchBtn").click(function(event) {
                var form = new liger.get("searchBar");
                var data = form.getData();
                console.log(data);
                for (name in data){
                    grid.setParm(name,data[name]);
                };
                grid.reload();
            });
            $("#clearBtn").click(function(event) {
                clearLigerForm("searchBar");
            });
        });
        //格式化时间
        function renderDate(rowdata, index, value){
            var dateStr = "";
            if(null != value){
                var date = new Date(value);
                dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
            }
            return dateStr;
        }               
        function showDetail(i){
        	var ss=liger.get('ligergrid1');
        	var h =ss.data.rows[i].recResult;
        	$.ligerDialog.SQalert({content:h,width:650,height:200,SQ_timeout: 0});
        }
        function showDetailC(i){
        	var ss=liger.get('ligergrid1');
        	var h =ss.data.rows[i].content;
        	$.ligerDialog.SQalert({content:h,width:650,height:200,SQ_timeout: 0});
        }
    </script>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox col_33">
                    <div class="label">接口类型</div>
                    <div class="field">
                        <select name="txCode"  id="txCode"  disabled="disabled">
                            <option value=" " selected="selected">--请选择--</option>
                            <option value="3001" >注册</option>
                            <option value="05001" >四要素验证</option>
                            <option value="06004" >三要素验证</option>
                        </select>
                    </div>
                    <div style="display: none">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">结果</div>
                    <div class="field">
                        <select name="recCode"  id="recCode"  disabled="disabled">
                            <option value=" " selected="selected">--请选择--</option>
                            <option value="2" >异常</option>
                            <option value="1" >成功</option>
                            <option value="0" >失败</option>
                        </select>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">内容查询</div>
                    <div class="field">
                        <input name="content" id="content" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="clearFix"></div>
                <div class="btnsBox">
                    <span id="searchBtn" class="sq-button sq-button-hasicon"><i class="sqBtnIco_1"></i>查询</span>
                    <span id="clearBtn" class="sq-button sq-button-hasicon"><i class="sqBtnIco_19"></i>清空</span>
                    
                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
            </div>
        </form>
    </div>
</div>
<div id="ligergrid1" class="sq-grid"></div>
<div id="modifyPayFreediv" style="display:none">
    <form id="modifyPayFreeForm">
        <div class="fieldset1 tabel_col noBorder clearFix">
            <div class="fieldBox col_33">
                <div class="label">免费次数</div>
                <div class="field">
                    <input name="modifyfreeNum" id="modifyfreeNum" type="text" class="ui-textbox" value="0" validate="{required:true}">
                </div>
            </div>
        </div>
    </form>
</div>
<div id="addPayFreediv" style="display:none">
    <form id="addPayFreeForm">
        <div class="fieldset1 tabel_col noBorder clearFix">
            <div class="fieldBox col_33">
                <div class="label">用户手机号</div>
                <div class="field">
                    <input name="addphone" id="addphone" type="text" class="ui-textbox" value="" validate="{required:true}">
                </div>
            </div>
            <div class="clearFix"></div>
            <div class="fieldBox col_33">
                <div class="label">免费次数</div>
                <div class="field">
                    <input name="addfreeNum" id="addfreeNum" type="text" class="ui-textbox" value="" validate="{required:true}">
                </div>
            </div>
            <div class="clearFix"></div>
            <div class="fieldBox col_33">
                <div class="label">事业部</div>
                <div class="field">
                    <select name="addisdept"  id="addisdept" validate="{required:true,select:true}">
                        <option value=" " selected="selected">--请选择--</option>
                        <c:forEach items="${orglist}" var="opt">
                            <option value="${opt.key}">${opt.value}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
</html>
